<%--

    Licensed to Apereo under one or more contributor license
    agreements. See the NOTICE file distributed with this work
    for additional information regarding copyright ownership.
    Apereo licenses this file to you under the Apache License,
    Version 2.0 (the "License"); you may not use this file
    except in compliance with the License.  You may obtain a
    copy of the License at the following location:

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

--%>
<jsp:directive.include file="includes/top.jsp" />


<%--<c:if test="${not pageContext.request.secure}">--%>
    <%--<div id="msg" class="errors">--%>
        <%--<h2><spring:message code="screen.nonsecure.title" /></h2>--%>
        <%--<p><spring:message code="screen.nonsecure.message" /></p>--%>
    <%--</div>--%>
<%--</c:if>--%>

<%--<div id="cookiesDisabled" class="errors" style="display:none;">--%>
    <%--<h2><spring:message code="screen.cookies.disabled.title" /></h2>--%>
    <%--<p><spring:message code="screen.cookies.disabled.message" /></p>--%>
<%--</div>--%>


<%--<c:if test="${not empty registeredService}">--%>
    <%--<c:set var="registeredServiceLogo" value="images/webapp.png"/>--%>
    <%--<c:set var="registeredServiceName" value="${registeredService.name}"/>--%>
    <%--<c:set var="registeredServiceDescription" value="${registeredService.description}"/>--%>

    <%--<c:choose>--%>
        <%--<c:when test="${not empty mduiContext}">--%>
            <%--<c:if test="${not empty mduiContext.logoUrl}">--%>
                <%--<c:set var="registeredServiceLogo" value="${mduiContext.logoUrl}"/>--%>
            <%--</c:if>--%>
            <%--<c:set var="registeredServiceName" value="${mduiContext.displayName}"/>--%>
            <%--<c:set var="registeredServiceDescription" value="${mduiContext.description}"/>--%>
        <%--</c:when>--%>
        <%--<c:when test="${not empty registeredService.logo}">--%>
            <%--<c:set var="registeredServiceLogo" value="${registeredService.logo}"/>--%>
        <%--</c:when>--%>
    <%--</c:choose>--%>

    <%--<div id="serviceui" class="serviceinfo">--%>
        <%--<table>--%>
            <%--<tr>--%>
                <%--<td><img src="${registeredServiceLogo}"></td>--%>
                <%--<td id="servicedesc">--%>
                    <%--<h1>${fn:escapeXml(registeredServiceName)}</h1>--%>
                    <%--<p>${fn:escapeXml(registeredServiceDescription)}</p>--%>
                <%--</td>--%>
            <%--</tr>--%>
        <%--</table>--%>
    <%--</div>--%>
    <%--<p/>--%>
<%--</c:if>--%>
<div class="login_header">
    <div class="login_headerLog">
        <img src="_files/images/logo.png"/><div class="login_headerText"><spring:message code="logo.title" /></div>
    </div>
</div>
<div class="login_context">
    <div class="login_inputArea">
        <form:form method="post" id="fm1" commandName="${commandName}" htmlEscape="true">

            <form:errors path="*" id="msg" cssClass="errors alert alert-danger" element="div" htmlEscape="false" />

            <%--<div class="form-group">--%>
                <%--<label for="username"><spring:message code="screen.welcome.label.netid" /></label>--%>
                <%--&lt;%&ndash;<form:input cssClass="btn btn-primar" cssErrorClass="error" id="username" size="25" tabindex="1" accesskey="${userNameAccessKey}" path="username" autocomplete="off" htmlEscape="true" />&ndash;%&gt;--%>
            <%--</div>--%>

            <%--<div class="form-group">--%>

                <%--<label for="password"><spring:message code="screen.welcome.label.password"/></label>--%>

            <%--</div>--%>

            <c:choose>
                <c:when test="${not empty sessionScope.code}">
                    <div class="form-group">
                        <label for="code"><spring:message code="screen.welcome.label.code" /></label>
                        <div class="row">
                            <div class="col-xs-5">
                                <input class="form-control" id="code" name="code">
                            </div>
                            <div class="col-xs-7" id="codeBtn">
                                <img id="codeImg" src="/out/kaptcha" style="width: 100%"/>
                            </div>
                        </div>
                    </div>
                </c:when>
            </c:choose>


            <%--<div style="width: 100%; text-align: center">--%>
                <%--<input type="hidden" name="lt" value="${loginTicket}" />--%>
                <%--<input type="hidden" name="execution" value="${flowExecutionKey}" />--%>
                <%--<input type="hidden" name="_eventId" value="submit" />--%>

                <%--<input class="btn btn-primary" name="submit" accesskey="l" value="<spring:message code="screen.welcome.button.login" />" tabindex="6" type="submit" />--%>
                <%--<input class="btn btn-default" name="reset" accesskey="c" value="<spring:message code="screen.welcome.button.clear" />" tabindex="7" type="reset" />--%>
            <%--</div>--%>
        <div class="login_inputAreaBg">
            <div class="login_userNameArea">
                <div class="login_inputAreaBorder">
                    <div class="login_inputArea_logo">
                        <img src="_files/images/loginUsernameLogo.png"/>
                    </div>
                    <form:input id="username" size="25" tabindex="1" accesskey="${userNameAccessKey}" path="username" autocomplete="off" htmlEscape="true" />
                    <%--<input id="login_userName" type="text" placeholder="请输入用户名"/>--%>
                </div>

            </div>
            <div class="login_passwordArea">
                <div class="login_inputAreaBorder">
                    <div class="login_inputArea_logo">
                        <img src="_files/images/loginPasswordLogo.png"/>
                    </div>
                    <form:password id="password" size="25" tabindex="2" path="password"  accesskey="${passwordAccessKey}" htmlEscape="true" autocomplete="off" />

                    <%--<input id="login_password" type="password" placeholder="请输入密码"/>--%>
                </div>
            </div>
            <div class="loginBtnBg">
                <input class="loginBtn" name="submit" accesskey="l" value="<spring:message code="screen.welcome.button.login" />" tabindex="6" type="submit" />
                <%--<button class="loginBtn">登录</button>--%>
            </div>
            <div class="otherLoginTitle">
                <span><spring:message code="other.login.message"/></span>
            </div>
            <div class="otherLoginBtnArea">
                <div class="otherLoginBtnAreaBg">
                    <div>
                        <button class="otherLogin_wechat"></button>
                    </div>
                    <div>
                        <button class="otherLogin_qq"></button>
                    </div>
                    <div>
                        <button class="otherLogin_weibo"></button>
                    </div>
                </div>
            </div>

        </div>
            <input type="hidden" name="lt" value="${loginTicket}" />
            <input type="hidden" name="execution" value="${flowExecutionKey}" />
            <input type="hidden" name="_eventId" value="submit" />
        </form:form>

    </div>

</div>
<div class="login_footer">

</div>

<script type="text/javascript">
    $(document).ready(function(){
        $('#codeBtn').on('click', function (e) {
            $('#codeImg').attr('src', '/out/kaptcha?' + Math.random());
        });
    });
</script>


<jsp:directive.include file="includes/bottom.jsp" />
